<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>

<head>
<title>价格调整监控——恒拓运价魔方</title>
<link rev="stylesheet" media="all"
	href="<%=request.getContextPath()%>/fare/css/style.css"
	type="text/css" rel="stylesheet">
		<script type="text/javascript" src="<%=request.getContextPath() %>/fare/js/menu.js"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/js/jquery-1.6.4.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/FusionCharts/FusionCharts.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/lib/ligerUI/js/ligerui.min.js"></script>
<link
	href="<%=request.getContextPath()%>/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css"
	rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/fare/css/base.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/common.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/multiblepicker.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/FDCDialog.js"></script>
<link
	href='<%=request.getContextPath()%>/fare/js/cityquery/cityquery.css'
	rel="stylesheet" type="text/css" />
<script type='text/javascript'
	src='<%=request.getContextPath()%>/fare/js/cityquery/citylist.js'></script>
<script type='text/javascript'
	src='<%=request.getContextPath()%>/fare/js/cityquery/querycity.js'></script>

<style type="text/css">
body {
	font-family: "微软雅黑", Lucida Grande, Geneva, Arial, Verdana,
		Lucida Sans Unicode, Helvetica, sans-serif;
	padding: 20px;
	font-size: 13px;
	box-shadow: 0 0 5px rgba(33, 94, 222, 0.3) inset;
	font-size: 13px;
	/* border: 1px solid #D1DAEF; */
}

table {
	empty-cells: hide;
}


#input_form {
	border: 1px solid #000000;
	margin: 6px 0 0 0;

}

#companySelect {
	text-align: center;
}


</style>
</head>
<body>
<jsp:include page="/pages/system/feedback/feedback.jsp" ></jsp:include>
	<div class="widthmd">
		<div class="main">
			<h1
				style="text-align: center; font-size: 18px; font-weight: bold; letter-spacing: 5px;">运价数据中心</h1>
	
			<div class="sideBar">
				<div class="box">
					<ul class="menu">
						<li class="level1"><a href="#none">运价查询</a>
							<ul class="level2">
								<li><a href="#none">运价查询</a></li>
								<li><a href="#none">运价查询</a></li>
								<li class="mgb"><a href="#none">运价查询</a></li>

							</ul></li>

						<li class="level1"><a href="#none">运价分析</a>
							<ul class="level2">
								<li><a href="#none">运价处理</a></li>
								<li><a href="#none">运价处理</a></li>
								<li><a href="#none">运价处理</a></li>
								<li><a href="#none">运价处理</a></li>

							</ul></li>
					</ul>
					<div class="line"></div>
				</div>
	
			</div>
			<div class="content" style="width:750px;">

				<div id="input_form">
					<form id="monitoringForm" method="post">
						<TABLE id="mytable">
							<TR>
								<TD width="10%" height="26" style="text-align: left">航空公司：</TD>
								<TD width="40%" height="26"><select id="companySelect"
									name="companySelect" class="td1">
										<option value="cs" selected="selected">南航</option>
										<option value="ds" class="td1">中航</option>
										<option value="as" class="td1">深航</option>
								</select> <span style="color: #ff0000">*</span></TD>
								<td></td>
								<td></td>

							</TR>
							<TR>
								<TD width="10%" height="26" class="label"
									style="text-align: left">航&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;线：</TD>
								<TD style="width:180px;"><span>从</span> <input type="text" name="depCity"
									id="depCity" value="" style="width:80px;"> <span>到</span> <input
									type="text" name="arrCity" id="arrCity" value="" style="width:80px;"> <span
									style="color: #ff0000">*</span></TD>

								<TD height="26" style="text-align: left">航班：</TD>
								<TD><select name="flightTime" class="td1">
										<option value="time1" selected="selected">02:00</option>
										<option value="time2">03:00</option>
										<option value="time3">04:00</option>
								</select> <span>08：30</span></TD>
								<TD height="26" class="label" style="text-align: left">舱位等级：</TD>

								<TD colspan="1"><select name="cabinLevel"
									style="width: 100px" class="td1">
										<option value="1">1</option>
										<option value="2">2</option>
								</select></TD>
							</TR>
							<TR >
								<TD style="text-align: left">航班日期：</TD>
								<TD><input type="text" style="width: 70px" name="beginDate"
									id="beginDate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})"
									required> <span></span> <span style="color: #ff0000">*</span></TD>
								<TD class="label" style="text-align: left">提前购买天数：</TD>
								<TD><select id="buyDay" name="buyDay" style="width: 100px"
									class="td1">
										<option value="1">1天</option>
										<option value="2">2天</option>
								</select> <span style="color: #ff0000">*</span></TD>
							</TR>

							<TR>
								<TD height="26" class="label" style="text-align: left">数据来源：</TD>
								<TD colspan="1"><input type="radio" name="dataSource"
									value="web" checked="checked" />仅官网 <input type="radio"
									name="dataSource" value="all" />全渠道</TD>

								<td></td>
								<td></td>
								<TD height="26" align="center" colspan="4"><input
									type="button" name="searchButton" value="查询"
									onclick="javascript:checkJspForm();" id="searchButton"
									style="width: 50px;"> <input type="reset"
									name="clearButton" value="清空" id="clearButton"
									style="width: 50px;"></TD>
							</TR>

						</TABLE>
					</form>
				</div>
				<div style="display: none">
					<input id="text" type="text" />
				</div>
				<div id="lineChartContainer"
					style="margin-top: 30px; text-align: center;"></div>
			</div>
		</div>
	</div>
	<div class="clear"></div>
	<div class="bottom">版权所有：广州市恒拓开源有限公司</div>


	</div>

	<script type="text/javascript">
 		function setChart(){
 			
 			$("#lineChartContainer").show();
 			var xml = document.getElementById('text').value;
		   var chart = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/Line.swf", "ChartId", "600", "350", "0", "0");
 			chart.setDataXML($('#text').val());//把后台的返回数据传给FusionCharts 	
 		<%-- 	chart.setDataURL("<%=request.getContextPath()%>/fare/fdc/Data/Line.xml"); --%>
			chart.render("lineChartContainer");

		}
 		
 		function initChart(){
 			$("#lineChartContainer").show();
		   var chart = new FusionCharts("<%=request.getContextPath()%>/FusionCharts/Line.swf", "ChartId", "600", "350", "0", "0");
 
 			chart.setDataURL("<%=request.getContextPath()%>/fare/fdc/Data/Line.xml");
			chart.render("lineChartContainer");
 		}
	</script>
	<script type="text/javascript">
	
	function selectOne(obj) {
		var objCheckBox = document.getElementsByName("checkbox");
		for ( var i = 0; i < objCheckBox.length; i++) {
			//判断复选框集合中的i元素是否为obj，若为否则便是未被选中 
			if (objCheckBox[i] != obj) {
				objCheckBox[i].checked = false;
			} else {
				//若是，原先为被勾选的变成勾选，反之则变成未勾选 
				//objCheckBox[i].checked = obj.checked; 

				//或者使用下句，亦可达到同样效果 
				objCheckBox[i].checked = true;
			}
		}
	}
	
    
	function checkJspForm(){
		if(!checkiForm()){
			return false;
		}
		changeAction('/fdc-web/loginPackage/priceMonitorAction!getXML.action');
		FDCDialog.lockWindow(true,'<%=request.getContextPath()%>');
			setTimeout(
					function() {
						loadAndDisplayData('/fdc-web/loginPackage/priceMonitorAction!getXML.action');
					}, 1);
		}

		function changeAction(url) {
			$('#monitoringForm').attr('action', url);
		}
		function checkiForm() {
			//alert($("#beginDate").val());
			if ($('#depCity').val() == '中文/拼音'
					|| $('#arrCity').val() == '中文/拼音') {
				if (!window.confirm('航线不选，查询比较耗时，是否继续？')) {
					return false;
				}
			}

			if ($("#beginDate").val() == "" || $("#beginDate").val() == "") {
				if (!window.confirm('还有航班日期没有选择,请先选择航班日期')) {
					return false;
				}
			}
			return true;
		}

		function loadAndDisplayData(url) {
			if ($('#depCity').val() != '' && $('#arrCity').val() != '') {
				$.ajax({
							url : url,
							data : {
								companySelect : $('#companySelect').val(),
								depCity : $('#depCity').val(),
								arrCity : $('#arrCity').val(),
								flightTime : $('#flightTime').val(),
								beginDate : $('#beginDate').val(),
								endDate : $('#endDate').val(),
								buyDay : $('#buyDay').val(),
								depInterval : $(
										'input[name="checkbox"]:checked').val(),
								depTimeHour1 : $('#depTimeHour1').val(),
								depTimeHour2 : $('#depTimeHour2').val(),
								depTimeMin1 : $('#depTimeMin1').val(),
								depTimeMin2 : $('#depTimeMin2').val(),
								dataSource : $(
										'input[name="dataSource"]:checked')
										.val(),
								cabinLevel : $("#cabinLevel").val()
							},
							cache : false,
							async : false,
							type : "POST",
							complete : function(jqXHR, textStatus) {
								//	alert(jqXHR.responseText);

								if (jqXHR.status == 200) {
									var result = parseObj(jqXHR.responseText);
									var xml = result.xml;
									//alert(xml);
									$('#text').val(xml);
									setChart();

								}
							}
						});
			}
			FDCDialog.unLockWindow();
		}

		$(function() {
			$('#depCity').querycity({
				'data' : citysFlight,
				'tabs' : labelFromcity,
				'hotList' : hotList
			});
			$('#arrCity').querycity({
				'data' : citysFlight,
				'tabs' : labelFromcity,
				'hotList' : hotList
			});
			initChart();
		});
	</script>

</body>
</html>